Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving performance setting widget data. #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gtrifidis
Copy link

Small performance improvement workaround when consumer knows upfront when widget data do not include any observables.

   options.dataIsSimpleJS is a simple property extending the binding options.
    The reason for adding this property is to avoid unnecessary iteration/subscriptions through a possibly large dataset.
    If we have a large dataset say > 35000 items the performance hit is quite big. Some browsers are not very forgiving (FF) and display non responsive script error.
    If the consumer knows that his data are consisted by simple js objects , he can just set the new flag to true to avoid the iteration.
    
    We could use the useKOTemplates to achieve the same , but it is not clear to me how that would affect now or in a future version consumer implementations.
    Having an option decicated for this usage is the cleanest way to address this issue.
    Here is a fiddle to demonstrate the performance difference using the useKOTemplates
    http://jsfiddle.net/gtrifidis/mC4Vw/14/
    Just remove the useKOTemplates from the binding to see it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant